﻿using SelfMadeMillionaire.Core.Entities;
using SelfMadeMillionaire.Core.Enums;
using SelfMadeMillionaire.Core.Repositories;
using SelfMadeMillionaire.Core.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SelfMadeMillionaire.BLL.Services
{
	public class TrackingPortfolioService : ITrackingPortfolioService
	{
		ITrackingPortfolioRepository _trackingPortfolioRepository;

		public TrackingPortfolioService(ITrackingPortfolioRepository trackingPortfolioRepository )
		{
			_trackingPortfolioRepository = trackingPortfolioRepository;
		}

		public TrackingPortfolioInfo Get(TrackingPortfolioType tpType)
		{
            return _trackingPortfolioRepository.Get(tpType) ?? new TrackingPortfolioInfo();
		}

		public void Save(TrackingPortfolioInfo info)
		{
			_trackingPortfolioRepository.Update(info);
		}
	}
}
